#include<stdio.h>
typedef struct
{
	int numerator;
	int denominator;
}Fraction;
int maxgongyueshu(int a,int b)
{
	int k=a<b?a:b;
	while(k>0)
	{
		if(a%k==0&&b%k==0)
		{
			return k;
		}
		k--;
	}
}
int mingongbeishu(int a,int b)
{
	int k=a>b?a:b;
	while(1)
	{
		if(k%a==0&&k%b==0)
		{
			return k;
		}
		k++;
	}
}
Fraction mul(Fraction *f1,Fraction *f2)
{
	Fraction result;
	result.numerator=f1->numerator*f2->numerator;
	result.denominator=f1->denominator*f2->denominator;
	int t=maxgongyueshu(result.numerator,result.denominator);
	result.numerator=result.numerator/t;
	result.denominator=result.denominator/t;
	return result;
}
Fraction add(Fraction *f1,Fraction *f2)
{
	Fraction result;
	int min=mingongbeishu(f1->denominator,f2->denominator);
	result.denominator=min;
	int t1=min/f1->denominator;
	int t2=min/f2->denominator;
	result.numerator=f1->numerator*t1+f2->numerator*t2;
	int t=maxgongyueshu(result.numerator,result.denominator);
	result.numerator=result.numerator/t;
	result.denominator=result.denominator/t;
	return result;
}
int main()
{
	Fraction a,b;
	scanf("%d %d",&a.numerator,&a.denominator);
	scanf("%d %d",&b.numerator,&b.denominator);
	Fraction f1=add(&a,&b);
	Fraction f2=mul(&a,&b);
	printf("%d %d\n",f1.numerator,f1.denominator);
	printf("%d %d",f2.numerator,f2.denominator);
	return 0;
}
